<?php

namespace app\common\model\course;

use app\common\model\Model;
use traits\model\SoftDelete;

class Content extends Model
{

    use SoftDelete;

    protected static function init()
    {
        self::afterInsert(function ($row) {
            $pk = $row->getPk();
            $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
        });
    }

    // 表名
    protected $name = 'course_content';

    // 追加属性
    protected $append = [

    ];


}
